<?php

namespace Xlib\Form\Prepare;

trait Prepare {

    public function __construct ($name = null, $options = array())
    {
        parent::__construct($name, $options);
        $attributes = null;
        $labelAttributes = null;
        if (isset($options['attributes'])) {
            $attributes = (array) $options['attributes'];
        }
        if (isset($options['labelAttributes'])) {
            $labelAttributes = (array) $options['labelAttributes'];
        }
        $this->prepareAttributes($attributes);
        $this->prepareLabelAttributes($labelAttributes);
    }

    protected function prepareAttributes (array $elementAttributes = null)
    {
    }

    protected function prepareLabelAttributes (array $elementAttributes = null)
    {
    }

}